from ..serializers.admin import AdminListSerializer
from apps.meiduo_admin.utils import PageNum
from apps.users.models import User
from rest_framework.viewsets import ModelViewSet
from rest_framework.generics import ListAPIView
from django.contrib.auth.models import Group
from ..serializers.group import GroupListSerializer


class AdminListModelView(ModelViewSet):

    queryset = User.objects.filter(is_staff=True)
    serializer_class = AdminListSerializer
    pagination_class = PageNum


# 获取group列表数据视图
class GroupListInfoView(ListAPIView):

    queryset = Group.objects.all()
    serializer_class = GroupListSerializer